<?php defined('InShopNC') or exit('Access Invalid!');?>

<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
<?php if ($output['store_info']) { ?>
      <a class="back" href="index.php?act=promotion_booth&op=booth_quota_list" title="返回套餐列表">
        <i class="fa fa-arrow-circle-o-left"></i>
      </a>
      <div class="subject">
        <h3><?php echo $lang['nc_promotion_booth']; ?> - 查看/管理店铺“<?php echo $output['store_info']['store_name']; ?>”参与活动的商品</h3>
        <h5><?php echo $lang['nc_promotion_booth_subhead']; ?></h5>
      </div>
<?php } else { ?>
      <div class="subject">
        <h3><?php echo $lang['nc_promotion_booth'];?></h3>
        <h5><?php echo $lang['nc_promotion_booth_subhead'];?></h5>
      </div>
      <ul class="tab-base nc-row">
       <?php /* <li><a href="<?php echo urlAdminShop('promotion_booth', 'goods_list');?>">商品列表</a></li>
        <li><a href="<?php echo urlAdminShop('promotion_booth', 'booth_quota_list');?>">套餐列表</a></li>
        <li><a href="<?php echo urlAdminShop('promotion_booth', 'booth_setting');?>"><?php echo $lang['nc_config'];?></a></li> */?>
         <li><a href="<?php echo urlAdminShop('promotion_booth', 'hjzt_adv_list');?>">黄金专题广告</a></li>
         <li><a href="<?php echo urlAdminShop('promotion_booth', 'byzt_adv_list');?>">白银专题广告</a></li>
         <li><a href="JavaScript:void(0);" class="current">铂金专题广告</a></li>
         <li><a href="<?php echo urlAdminShop('promotion_booth', 'zbzt_adv_list');?>">珠宝专题广告</a></li>
         <li><a href="<?php echo urlAdminShop('promotion_booth', 'yszt_adv_list');?>">预售专题广告</a></li>
         <li><a href="<?php echo urlAdminShop('promotion_booth', 'index_adv_list');?>">首页广告</a></li>
      </ul>
<?php } ?>
    </div>
  </div>
  <!-- 操作说明 -->
  <div class="explanation" id="explanation">
    <div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
      <h4 title="<?php echo $lang['nc_prompts_title'];?>"><?php echo $lang['nc_prompts'];?></h4>
      <span id="explanationZoom" title="<?php echo $lang['nc_prompts_span'];?>"></span>
    </div>
    <ul>
      <li>被推荐商品将在该商品所在的分类及其上级分类的商品列表左侧随机出现</li>
    </ul>
  </div>

  <div id="flexigrid"></div>
</div>

<script>
$(function(){
    $("#flexigrid").flexigrid({
        url: 'index.php?act=promotion_booth&op=bjzt_adv_list_xml&store_id=<?php echo $output['store_id']; ?>',
        colModel: [
            {display: '操作', name: 'operation', width: 150, sortable: false, align: 'center', className: 'handle'},
            {display: '店铺名称', name: 'store_name', width: 200, sortable: false, align: 'left'},
            {display: '广告图片', name: 'adv_image', width: 400, sortable: false, align: 'left'},
            {display: '开始时间', name: 'start_time', width: 100, sortable: false, align: 'left'},
            {display: '结束时间', name: 'end_time', width: 100, sortable: false, align: 'left'},
            {display: '位置', name: 'place', width: 100, sortable: false, align: 'left'},
            {display: '连接地址', name: 'adv_url', width: 180, sortable: false, align: 'center'},
            {display: '状态', name: 'state', width: 80, sortable: false, align: 'center'}
        ],
        searchitems: [
            {display: '商品SKU', name: 'goods_id', isdefault: true}
        ],
        sortname: "bl_goods_id",
        sortorder: "desc",
        title: '铂金专题广告列表'
    });
});

$('a[data-href]').live('click', function() {
    if ($(this).hasClass('confirm-del-on-click') && !confirm('确定删除?')) {
        return false;
    }

    $.getJSON($(this).attr('data-href'), function(d) {
        if (d && d.result) {
            $("#flexigrid").flexReload();
        } else {
            alert(d && d.message || '操作失败！');
        }
    });
});

</script>
